package com.sanyang.lawyer.service.record;

import com.sanyang.lawyer.entity.Case_court;
import com.sanyang.lawyer.entity.Case_law;
import com.sanyang.lawyer.entity.Record;
import com.sanyang.lawyer.entity.Recordpage;
import com.sanyang.lawyer.mapper.record.RecordMapper;
import com.sanyang.lawyer.mapper.record.Record_borrowMapper;
import com.sanyang.lawyer.mapper.record.Record_caselawMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class RecordService {
    @Autowired
    private RecordMapper recordmapper;
    @Autowired
    private Record_caselawMapper record_caselawmapper;
    //查询所有档案
    public List<Record> listmyrecordall(Map<String,Object> map){
        return this.recordmapper.listmyrecordall(map);
    }
    public List<Record> listrecordall(Map<String,Object> map){
        return this.recordmapper.listrecordall(map);
    }
   //查询单个档案
    public Record getbyrecord(int recordid){
        return this.recordmapper.getbyrecord(recordid);
    }
    //查询档案表中的数据数
    public int getcountrecord(Recordpage recordpage){
        return this.recordmapper.getcountrecord(recordpage);
    }
    //查询案件
    public List<Case_law> listallid(Map<String,Object> map){
       return this.record_caselawmapper.listallid(map);
    };
    //查询案件的数据总数
    public int listcountcase(Map<String,Object> map){
        return this.record_caselawmapper.listcountcase(map);
    }
    //添加归档记录
    public void insertrecord(Record record){
        this.recordmapper.insertrecord(record);
    };
    public void updaterecord(Record record){
        this.recordmapper.updaterecord(record);
    }
    //删除
    public void deleterecord (Record record){
        this.recordmapper.deleterecord(record);
    }
    //查询单个案件
    public Case_law getbycaselaw(String id){
        return  this.record_caselawmapper.getbycaselaw(id);
    }
    //查询出url所指定的文件
    public Record getbyurl(String fileurl){
        return this.recordmapper.getbyurl(fileurl);
    }
    //查询单个档案记录多条件
    public Record getrecord(Record record){
        return  this.recordmapper.getrecord(record);
    }
}
